package edu.gdkm.ssm.controller;

import edu.gdkm.ssm.dao.ISysLogDao;
import edu.gdkm.ssm.domain.SysLog;
import edu.gdkm.ssm.service.ISysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping("sysLog")
public class SysLogController {

    @Autowired
    private ISysLogService sysLogService;

    @GetMapping("findAll.do")
    public ModelAndView findAll() throws Exception{
        ModelAndView modelAndView = new ModelAndView();
        List<SysLog> sysLogList = this.sysLogService.findAll();
        modelAndView.addObject("sysLogs", sysLogList);
        modelAndView.setViewName("syslog-list");
        return modelAndView;
    }
}
